<link href="/theme/Default/css/detail/detail.css" rel="stylesheet">
<link href="/theme/Default/css/full-slider.css" rel="stylesheet">
<link href="/theme/Default/css/shop/shopDetail.css" rel="stylesheet">
<link href="/theme/Default/css/member/manage.css" rel="stylesheet">

<!-- quang cao -->

<?php if (!empty($banners)): ?>
	
			<div class="detail-adv">
				<?php foreach ($banners as $item): ?>
				<div class="detail-adv-child">
					<a href="http://<?php echo $item['Banner']['url']; ?>" target="_blank">
						<img src="../../<?php echo $item['Banner']['img'] ?>"/>
					</a>
				</div>
				<div class="detail-adv-child margin-top">
				</div>	
				<?php endforeach ?>	
			</div>
		
<?php endif ?>		
<!-- end quang cao -->

<div id="page-detail">
	<div class="detail-content">
		<div class="detail_breakcrumb">

			<a href="/search">maytot.vn</a> » 
			<a href="../search/?searchRegion=<?php echo $region_name['Region']['region_id'];?>"><?php echo $region_name['Region']['region_name'];?></a> » 
			<a href="../search/?searchRegion=<?php echo $region_name['Region']['region_id'];?>&searchCategory=<?php echo $post['Post']['category_ids'];?>"><?php echo $category_name['Category']['category_name'];?></a>
		</div>
		<div class="detail-main">
			<div class="detail-title">
				<?php echo $post['Post']['title_vn'];?>
			</div>
			<div class="detail-image">
				<header id="myCarousel" class="carousel slide">
			        <!-- Indicators -->
			        <ol class="carousel-indicators">
			            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
			            <?php for ($i=1; $i<=$numberImages-1; $i++){ ?>
			            	<li data-target="#myCarousel" data-slide-to="<?php echo $i; ?>"></li>
			            	<?php ;} ?>
			        </ol>

			        <!-- Wrapper for Slides -->
			        <div class="carousel-inner">
			            <div class="item active">
			                <!-- Set the first background image using inline CSS below. -->
			                <div class="fill" style="background:url('/<?php echo $image['0']['Image']['url'];?>') no-repeat center center transparent; background-size: 726px 498px;"></div>
			                <div class="carousel-caption">
			                </div>
			            </div>
			            <?php for ($i=1; $i<=$numberImages-1; $i++){ ?>
				            <div class="item">
				                <!-- Set the second background image using inline CSS below. -->
				                <div class="fill" style="background:url('/<?php echo $image[$i]['Image']['url'];?>') no-repeat center center transparent; background-size: 726px 498px;"></div>
				                <div class="carousel-caption">
				                </div>
				            </div>
			            	<?php ;} ?>
			        </div>

			        <!-- Controls -->
			        <a class="left carousel-control" href="#myCarousel" data-slide="prev">
			            <span class="icon-prev"></span>
			        </a>
			        <a class="right carousel-control" href="#myCarousel" data-slide="next">
			            <span class="icon-next"></span>
			        </a>
			    </header>

				<!-- <img src="/theme/Default/img/img-upload/hinh-xe-dao.jpg"/> -->
			</div>
			<div class="detail-price">
				GIÁ : <?php echo number_format($post['Post']['price']);?> VND
			</div>
			<div class="detail-wrap-one">
				<div class="wrap-one-left">
					<div>
						<span class="bold" style='width:110px'>
							Năm sản xuất : 
						</span>
						<span class="normal">
							<?php echo $post['Post']['product_year'];?>
						</span>
					</div>
					<div>
						<span class="bold" style='width:110px'>
							Nước sản xuất : 
						</span>
						<span class="normal" style='width:200px'>
							<?php echo $post['Post']['product_country'];?>
						</span>
					</div>
				</div>
				<div class="wrap-one-right">
					<div>
						<span class="bold" style='width:80px'>
							Tình trạng : 
						</span>
						<span class="normal" style='width:150px'>
							<?php echo $post['Post']['product_status'] == 1 ? ('Đã qua sử dụng') : ('Mới 100%');?>
						</span>
					</div>
					<div>
						<span class="bold" style='width:160px'>
							Thời gian đã sử dụng : 
						</span>
						<span class="normal">
							<?php echo $post['Post']['time_used'];?> Năm
						</span>
					</div>
					<div>
						<span class="bold" style='width:70px'>
							Di động : 
						</span>
						<span class="normal">
							<?php echo $post['Post']['phone_number'];?>
						</span>
					</div>
					<div>
						<span class="bold" style='width:50px'>
							Email : 
						</span>
						<span class="normal">
							<?php echo $post['Post']['mail_address'];?>
						</span>
					</div>
				<div class="clear"></div>
				</div>
				<div class="detail-main">
						<span class="normal" style='width:100%'>
							<?php echo nl2br($post['Post']['content']);?>
						</span>
				</div>
			</div>
		</div>
	</div>
	<div class="detail-content">
		<div class="detail-main">
			<div class="detail-title">
				Gian hàng liên quan sản phẩm:
			</div>
			<!-- list gian hang -->
			<?php if (!empty($shop)): ?>
			<table class="shop_detail" cellpadding="0" cellspacing="0">
				<tbody>
					<?php
						foreach ($shop as $item)
						{
					?>
					<tr class="tr">
						
						<td class="col_2">
							<a class="picture_x_small" href="#" target="_blank" rel="nofollow">
								<img width="68.81720430107526" maxwidth="80" maxheight="80" src="/<?php echo $item['Shop']['logo_image']?>" height="80">
							</a>
						</td>
						<td class="col_3">
							<div class="company_name">
								<a class="text_link" href="/gian-hang/<?php echo $item['Shop']['short_url'] ?>" target="_blank">
									<?php echo $item['Shop']['shop_name']?>
								</a>
							</div>
							<div class="address"><b><?php echo $item['Shop']['address']?></b></div>
							<div class="clear"></div>
						</td>
						<td class="col_4">
							<div class="phone">Điện thoại : <?php echo $item['Shop']['phone_number']?></div>
							<div class="website">
								<a class="text_link_2" href="http://<?php echo $item['Shop']['website'];?>" target="_blank" rel="nofollow"><?php echo $item['Shop']['website']?></a>
							</div>
						</td>
					</tr>
					<?php
						}
					?>
				</tbody>
			</table>
		<?php else: ?>
		<p>Không có gian hàng nào của sản phẩm này!</p>
		<?php endif ?>
		</div>
</div>
<div class="detail-content">
		<div class="detail-main">
			<div class="detail-title">
				Các tin đăng liên quan:
			</div>
			<!-- list tin dang -->
			<?php if (!empty($posts)): ?>
			<div class="tabs-container">
			<div class="tab-content">
				  	<div role="tabpanel" class="tab-pane active" id="tab-all">
				  	<table class="table table-striped">
			        <tbody>
			        	<?php foreach ($posts as $item): ?>
			        		<?php if ($item['Post']['id'] == $categoryid): ?>
			        			<?php continue; ?>
			        			<?php endif ?>
			        		<tr>
					            <td style='width:80px'>
									<a class='picture_x_small' href="/detail/<?php echo $item['Post']['short_url']?>"target="_blank" rel="nofollow">
										<img width="68.81720430107526" maxwidth="80" maxheight="80" height="80" src="/<?php echo $item['Post']['image_icon']?>"/>
									</a>
								</td>
								<td style='padding-left:20px'>
									<div class="company_name">
										<a class="text_link" href="/detail/<?php echo $item['Post']['short_url']?>" target="_blank"><?php echo $item['Post']['title_vn']?></a>
									</div>
									<div>
										<?php echo number_format($item['Post']['price']);?> VNĐ
									</div>
								</td>
					          </tr>
					          
			        	<?php endforeach ?>
			        </tbody>
					</table>
				  	</div>
				</div>
			</div>
			<?php else: ?>
					<p>Không có tin đăng nào liên quan sản phẩm này!
							</p>
			<?php endif ?>

		</div>
</div>
</div>


		
			